package date;

import java.time.LocalDate;
import java.util.Scanner;

public class Demo {
    public static void main(String[] args) {
        method1();

    }

    private static void method1() {
        LocalDate d = LocalDate.of(2004, 12, 18);
        LocalDate now = LocalDate.now();
        System.out.println(d.until(now).getYears());

        Scanner sc = new Scanner(System.in);
        String time = sc.next();// yyyy-MM-dd
        LocalDate date = LocalDate.parse(time);//符合规则
        System.out.println(date.until(now).getYears());
    }
}
